Optimal. Leaf size=55 \[ \frac {3 \tanh ^{-1}(\cos (x))}{2 a}-\frac {4 \cot (x)}{a}-\frac {4 \cot ^3(x)}{3 a}+\frac {3 \cot (x) \csc (x)}{2 a}+\frac {\cot (x) \csc ^2(x)}{a+a \sin (x)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 55, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {2847, 2827,
3852, 3853, 3855} \begin {gather*} -\frac {4 \cot ^3(x)}{3 a}-\frac {4 \cot (x)}{a}+\frac {3 \tanh ^{-1}(\cos (x))}{2 a}+\frac {3 \cot (x) \csc (x)}{2 a}+\frac {\cot (x) \csc ^2(x)}{a \sin (x)+a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2827
Rule 2847
Rule 3852
Rule 3853
Rule 3855
Rubi steps
\begin {align*} \int \frac {\csc ^4(x)}{a+a \sin (x)} \, dx &=\frac {\cot (x) \csc ^2(x)}{a+a \sin (x)}-\frac {\int \csc ^4(x) (-4 a+3 a \sin (x)) \, dx}{a^2}\\ &=\frac {\cot (x) \csc ^2(x)}{a+a \sin (x)}-\frac {3 \int \csc ^3(x) \, dx}{a}+\frac {4 \int \csc ^4(x) \, dx}{a}\\ &=\frac {3 \cot (x) \csc (x)}{2 a}+\frac {\cot (x) \csc ^2(x)}{a+a \sin (x)}-\frac {3 \int \csc (x) \, dx}{2 a}-\frac {4 \text {Subst}\left (\int \left (1+x^2\right ) \, dx,x,\cot (x)\right )}{a}\\ &=\frac {3 \tanh ^{-1}(\cos (x))}{2 a}-\frac {4 \cot (x)}{a}-\frac {4 \cot ^3(x)}{3 a}+\frac {3 \cot (x) \csc (x)}{2 a}+\frac {\cot (x) \csc ^2(x)}{a+a \sin (x)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(113\) vs. \(2(55)=110\).
time = 0.56, size = 113, normalized size = 2.05 \begin {gather*} \frac {-20 \cot \left (\frac {x}{2}\right )+3 \csc ^2\left (\frac {x}{2}\right )+36 \log \left (\cos \left (\frac {x}{2}\right )\right )-36 \log \left (\sin \left (\frac {x}{2}\right )\right )-3 \sec ^2\left (\frac {x}{2}\right )+8 \csc ^3(x) \sin ^4\left (\frac {x}{2}\right )+\frac {48 \sin \left (\frac {x}{2}\right )}{\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )}-\frac {1}{2} \csc ^4\left (\frac {x}{2}\right ) \sin (x)+20 \tan \left (\frac {x}{2}\right )}{24 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.13, size = 68, normalized size = 1.24
method | result | size |
default | \(\frac {\frac {\left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{3}-\left (\tan ^{2}\left (\frac {x}{2}\right )\right )+7 \tan \left (\frac {x}{2}\right )-\frac {1}{3 \tan \left (\frac {x}{2}\right )^{3}}+\frac {1}{\tan \left (\frac {x}{2}\right )^{2}}-\frac {7}{\tan \left (\frac {x}{2}\right )}-12 \ln \left (\tan \left (\frac {x}{2}\right )\right )-\frac {16}{\tan \left (\frac {x}{2}\right )+1}}{8 a}\) | \(68\) |
norman | \(\frac {-\frac {1}{24 a}+\frac {\tan \left (\frac {x}{2}\right )}{12 a}-\frac {3 \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{4 a}+\frac {3 \left (\tan ^{5}\left (\frac {x}{2}\right )\right )}{4 a}-\frac {\tan ^{6}\left (\frac {x}{2}\right )}{12 a}+\frac {\tan ^{7}\left (\frac {x}{2}\right )}{24 a}-\frac {15 \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{4 a}}{\tan \left (\frac {x}{2}\right )^{3} \left (\tan \left (\frac {x}{2}\right )+1\right )}-\frac {3 \ln \left (\tan \left (\frac {x}{2}\right )\right )}{2 a}\) | \(97\) |
risch | \(-\frac {9 i {\mathrm e}^{5 i x}-24 \,{\mathrm e}^{4 i x}+9 \,{\mathrm e}^{6 i x}-24 i {\mathrm e}^{3 i x}+39 \,{\mathrm e}^{2 i x}+7 i {\mathrm e}^{i x}-16}{3 \left ({\mathrm e}^{2 i x}-1\right )^{3} \left ({\mathrm e}^{i x}+i\right ) a}+\frac {3 \ln \left ({\mathrm e}^{i x}+1\right )}{2 a}-\frac {3 \ln \left ({\mathrm e}^{i x}-1\right )}{2 a}\) | \(99\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 120 vs.
\(2 (49) = 98\).
time = 0.40, size = 120, normalized size = 2.18 \begin {gather*} \frac {\frac {21 \, \sin \left (x\right )}{\cos \left (x\right ) + 1} - \frac {3 \, \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + \frac {\sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}}}{24 \, a} + \frac {\frac {2 \, \sin \left (x\right )}{\cos \left (x\right ) + 1} - \frac {18 \, \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} - \frac {69 \, \sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}} - 1}{24 \, {\left (\frac {a \sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}} + \frac {a \sin \left (x\right )^{4}}{{\left (\cos \left (x\right ) + 1\right )}^{4}}\right )}} - \frac {3 \, \log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{2 \, a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 168 vs.
\(2 (49) = 98\).
time = 0.40, size = 168, normalized size = 3.05 \begin {gather*} \frac {32 \, \cos \left (x\right )^{4} + 14 \, \cos \left (x\right )^{3} - 48 \, \cos \left (x\right )^{2} + 9 \, {\left (\cos \left (x\right )^{4} - 2 \, \cos \left (x\right )^{2} - {\left (\cos \left (x\right )^{3} + \cos \left (x\right )^{2} - \cos \left (x\right ) - 1\right )} \sin \left (x\right ) + 1\right )} \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) - 9 \, {\left (\cos \left (x\right )^{4} - 2 \, \cos \left (x\right )^{2} - {\left (\cos \left (x\right )^{3} + \cos \left (x\right )^{2} - \cos \left (x\right ) - 1\right )} \sin \left (x\right ) + 1\right )} \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) + 2 \, {\left (16 \, \cos \left (x\right )^{3} + 9 \, \cos \left (x\right )^{2} - 15 \, \cos \left (x\right ) - 6\right )} \sin \left (x\right ) - 18 \, \cos \left (x\right ) + 12}{12 \, {\left (a \cos \left (x\right )^{4} - 2 \, a \cos \left (x\right )^{2} - {\left (a \cos \left (x\right )^{3} + a \cos \left (x\right )^{2} - a \cos \left (x\right ) - a\right )} \sin \left (x\right ) + a\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\csc ^{4}{\left (x \right )}}{\sin {\left (x \right )} + 1}\, dx}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.48, size = 96, normalized size = 1.75 \begin {gather*} -\frac {3 \, \log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) \right |}\right )}{2 \, a} + \frac {a^{2} \tan \left (\frac {1}{2} \, x\right )^{3} - 3 \, a^{2} \tan \left (\frac {1}{2} \, x\right )^{2} + 21 \, a^{2} \tan \left (\frac {1}{2} \, x\right )}{24 \, a^{3}} - \frac {2}{a {\left (\tan \left (\frac {1}{2} \, x\right ) + 1\right )}} + \frac {66 \, \tan \left (\frac {1}{2} \, x\right )^{3} - 21 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 3 \, \tan \left (\frac {1}{2} \, x\right ) - 1}{24 \, a \tan \left (\frac {1}{2} \, x\right )^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 6.50, size = 89, normalized size = 1.62 \begin {gather*} \frac {7\,\mathrm {tan}\left (\frac {x}{2}\right )}{8\,a}-\frac {23\,{\mathrm {tan}\left (\frac {x}{2}\right )}^3+6\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2-\frac {2\,\mathrm {tan}\left (\frac {x}{2}\right )}{3}+\frac {1}{3}}{8\,a\,{\mathrm {tan}\left (\frac {x}{2}\right )}^4+8\,a\,{\mathrm {tan}\left (\frac {x}{2}\right )}^3}-\frac {{\mathrm {tan}\left (\frac {x}{2}\right )}^2}{8\,a}+\frac {{\mathrm {tan}\left (\frac {x}{2}\right )}^3}{24\,a}-\frac {3\,\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )}{2\,a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________